<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
	<f:loadBundle var="messages" basename="messages" />

	<head>
	<title>#{messages['avaliacaoForm.title']}</title>
	<style type="text/css">
.jscalendar-DB-div-style {
	position: absolute;
	margin-top: -69px;
	margin-left: -408px;
}
</style>
	</head>

	<h:messages errorClass="error" layout="table" style="width: 100%" />

	<p>Please fill in example's information below:</p>

	<h:form id="avaliacaoForm">
		<h:inputHidden value="#{avaliacaoForm.avaliacao.id}">
			<f:convertNumber />
		</h:inputHidden>
		<h:panelGrid columns="3" styleClass="detail" columnClasses="label">

			<h:outputLabel value="Conteudo" for="conteudoTitulo" />
			<h:selectOneListbox id="conteudoTitulo" required="false" size="1"
				requiredMessage="Informe o Conteudo!"
				value="#{avaliacaoForm.conteudoId}">
				<f:selectItems value="#{avaliacaoForm.listaDeConteudos}" />
			</h:selectOneListbox>
<br/>
			<h:outputLabel value="Usuario" for="UsuarioNome" />
			<h:selectOneListbox id="usuarioNome" required="false" size="1"
				requiredMessage="Informe o Usuario!"
				value="#{avaliacaoForm.usuarioId}">
				<f:selectItems value="#{avaliacaoForm.listaDeUsuarios}" />
			</h:selectOneListbox>
<br/>
			<h:outputLabel for="nota" value="#{messages['avaliacao.nota']}" />

			<h:inputText value="#{avaliacaoForm.avaliacao.nota}" id="nota"
				required="true" />
			<h:message for="nota" styleClass="errorMessage" />

			<h:panelGroup>
				<h:commandButton value="Save" action="#{avaliacaoForm.save}"
					id="save" styleClass="button" />
				<c:if test="${not empty avaliacaoForm.id}">
					<h:commandButton value="Delete" action="#{avaliacaoForm.delete}"
						id="delete" styleClass="button" />
				</c:if>
				<h:commandButton value="Cancel" action="cancel" immediate="true"
					id="cancel" styleClass="button" />
			</h:panelGroup>
		</h:panelGrid>
	</h:form>

	<script type="text/javascript">
    Form.focusFirstElement(document.forms['avaliacaoForm']);
</script>

</f:view>
</html>